package com.shawn.kaoshixingautobot.util;

import com.shawn.kaoshixingautobot.contants.Constants;
import javafx.scene.control.Alert;
import javafx.scene.image.Image;
import javafx.stage.Stage;

public class DialogUtils {
    public static void setDialogIcon(Alert alert) {
        try {
            Image logo = new Image(DialogUtils.class.getResourceAsStream(Constants.LOGO_PATH));
            Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
            stage.getIcons().add(logo);
        } catch (Exception e) {
            System.err.println("无法加载Logo: " + e.getMessage());
        }
    }
}
